﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace xna_game_engine.source
{
    public class LootPile
    {
        // Members
        protected List<BaseItem> mItemList;
        protected int mGold;
        protected bool mLooted;
        protected Texture2D mModel;
        protected Vector2 mPos;
        protected Rectangle mBoundingBox;

        // Functions
        public LootPile(Vector2 pos)
        {
            mGold = 0;
            mItemList = new List<BaseItem>();
            mLooted = false;
            mModel = GameGlobals.Content.Load<Texture2D>("sprites\\items\\lootpile");
            mPos = pos;
            mBoundingBox = new Rectangle((int)mPos.X, (int)mPos.Y, mModel.Width, mModel.Height);
        }

        public void AddGold(int amt)
        {
            mGold += amt;
        }
        public void AddItem(BaseItem item)
        {
            mItemList.Add(item);
        }

        public void SetLooted()
        {
            mLooted = true;
        }
        public void Draw()
        {
            GameSystems.Graphics.DrawImage(mModel, mPos, Color.White);
        }

        // Properties
        public int Gold
        {
            get { return mGold; }
        }

        public List<BaseItem> Items
        {
            get { return mItemList; }
        }

        public bool IsLooted
        {
            get { return mLooted; }
        }

        public Rectangle Bounds
        {
            get { return mBoundingBox; }
        }
    }
}
